﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Rhino.Mocks;
using System.IO;

namespace NSsh.Common.Tests
{
    [TestFixture]
    public class ExtensionsFixture
    {
        MockRepository _mockRepository;
        Stream _stream;

        [SetUp]
        public void Setup()
        {
            _mockRepository = new MockRepository();
            _stream = _mockRepository.CreateMock<Stream>();
        }

        [Test]
        public void ShouldWriteCorrectly()
        {
            byte[] data = { 1, 2, 3, 4 };

            using (_mockRepository.Record())
            {
                _stream.Write(data, 0, data.Length);
            }

            using (_mockRepository.Playback())
            {
                _stream.Write(data);
            }
        }
    }
}
